#include "Observer.h"

#include <iostream>

using namespace std;

int main(int argc, char *argv[])
{
    Subject  *subject   = new Subject();
    Observer *observer1 = new Observer(*subject);
    Observer *observer2 = new Observer(*subject);

    subject->createMessage("Hey, bro!");
    observer1->printMessage();
    observer2->printMessage();

    std::cout << "*******************" << std::endl;
    observer1->removeMeFromList();
    subject->createMessage("Yo, man!");
    observer1->printMessage();
    observer2->printMessage();

    std::cout << "*******************" << std::endl;
    observer2->removeMeFromList();
    subject->createMessage("Yeah, baby!");
    observer1->printMessage();
    observer2->printMessage();
    return 0;
}